<template>
    <div>
        <el-form :model="form" :rules="rules" ref="reForm" label-width="120px" label-position="left" class="mb_40">
            <el-form-item label="发送给：" prop="user">
                    <el-select v-model="form.user" placeholder="请选择用户" multiple>
                        <el-option label="微信支付" :value="1"></el-option>
                        <el-option label="支付宝支付" :value="2"></el-option>
                    </el-select>
            </el-form-item>
            <el-form-item label="标题：" prop="title">
                <el-input v-model="form.title" placeholder="请输入标题" />
            </el-form-item>
            <el-form-item label="内容：" prop="content">
                <el-input v-model="form.content" type="textarea" rows="8" placeholder="请输入内容" />
            </el-form-item>
        </el-form>
        <div class="dialog-userfooter">
            <el-button @click="handleCancle">取 消</el-button>
            <el-button type="primary" @click="handleSave">确 定</el-button>
        </div>
    </div>
</template>
<script>
import Citys from '@/components/Citys';
export default {
    components:{
        Citys
    },
    data(){
        return {
            form:{
                user:[],
                title:'',
                content:''
            },
            rules:{
                user:[{ required: true, message: '请选择用户', trigger: 'change' }],
                title:[{ required: true, message: '请输入标题', trigger: 'blur' }],
                content:[{ required: true, message: '请输入内容', trigger: 'blur' }],
            },
        }
    },

    created(){
        // console.log(this.user);
        // if(this.user){
        //     this.userparams.uid = this.user.id;
        //     this.user_login=this.user.user_login;
        //     this.userparams.role = [this.user.roleuser.role_id];
        // }
    },

    props:{
        user:{
            type:Object,
            default:null
        },
        type:{
            type:Number,
            default:1
        }
    },

    created(){
        
    },

    methods:{
        

        handleSave(){
            this.$refs.reForm.validate(valid=>{
                if(!valid) return;
                // userUpdate(this.userparams).then(res=>{
                //     if(res.code == 1){
                //         this.$message.success('修改成功');
                //         this.handleCancle(1)
                //     }
                // })
                this.handleCancle(1)
            })
        },

        handleCancle(type){
            this.$emit('close',type)
        },
    }
}
</script>
<style lang="scss" scoped>

</style>